package br.com.aquinoevasconcelos.user;

import javax.persistence.Column;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import br.com.aquinoevasconcelos.modelos.Endereco;

/**
 * @author Paulo Roberto
 * @email paulolima2008@hotmail.com
 * @version 1.0 @ Propriedade da Techcode
 */

@Entity(name = "usuario")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "identificacao", length = 20, discriminatorType = DiscriminatorType.STRING)
@DiscriminatorValue("Usuario")
public abstract class Usuario {

	@Id
	@GeneratedValue
	private long id;

	@Column(updatable = false, insertable = false)
	private String identificacao;

	@Column(length = 100)
	private String nome;

	@Column(length = 100)
	private String email;

	@Column(length = 50)
	private String login;

	@Column(length = 20)
	private String senha;

	@Column(length = 30)
	private String cnpj;

	@Embedded
	private Endereco endereco;

	// GETs e SETs
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getSenha() {
		return senha;
	}

	public void setSenha(String senha) {
		this.senha = senha;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}

	public String getCnpj() {
		return cnpj;
	}

	public void setCnpj(String cnpj) {
		this.cnpj = cnpj;
	}

}
